<?php

namespace App\Models\Recommend;

use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class Reclist0Data
 * @package App\Models\Recommend
 * @version July 27, 2018, 3:53 pm CST
 *
 * @property \App\Models\Recommend\Reclist0 reclist0
 * @property \App\Models\Recommend\Paneltpl paneltpl
 * @property string title
 * @property string subtitle
 * @property integer reclist0_id
 * @property string bulk
 * @property integer data_type
 * @property integer data_id
 * @property integer range
 * @property integer tpl_id
 * @property string img
 */
class Reclist0Data extends Model
{
    use SoftDeletes;


    public $table = 'reclist0_datas';
    

    protected $dates = ['deleted_at'];


    public $fillable = [
        'title',
        'subtitle',
        'reclist0_id',
        'bulk',
        'data_type',
        'data_id',
        'range',
        'tpl_id',
        'img'
    ];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        'title' => 'string',
        'subtitle' => 'string',
        'reclist0_id' => 'integer',
        'bulk' => 'string',
        'data_id' => 'integer',
        'range' => 'integer',
        'tpl_id' => 'integer',
        'img' => 'string'
    ];

    /**
     * Validation rules
     *
     * @var array
     */
    public static $rules = [
        
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     **/
    public function reclist0()
    {
        return $this->hasOne(\App\Models\Recommend\Reclist0::class, 'id', 'reclist0_id');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     **/
    public function paneltpl()
    {
        return $this->hasOne(\App\Models\Application\Paneltpl::class, 'id', 'tpl_id');
    }
}
